package week1;

import javax.swing.*;
import java.awt.*;

/**
 * @author The Setting sun
 * @create 2021-09-08 10:29
 */
public class GUITest2 {
    public static void main(String[] args) {
        //创建一个窗体对象
        JFrame jf = new JFrame();

        //创建中间容器
        JPanel jp = new JPanel();
        jp.setBackground(new Color(255, 192, 203));
        jf.add(jp);

        JLabel labelImg = new JLabel(new ImageIcon("樱龙.png"));


        JLabel label = new JLabel("犹豫就会败北！");
        label.setFont(new Font("宋体", Font.BOLD, 20));

        jp.add(label);
        jp.add(labelImg);

        //设置标题
        jf.setTitle("QQ登录");

        //设置窗体可见
        jf.setVisible(true);

        //设置窗体默认关闭操作
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        //设置窗体大小
        jf.setSize(600, 500);

        //设置窗体位置
        jf.setLocationRelativeTo(null);

    }
}
